package com.hamizhong.iflowers.web.action.admin.admin;

import com.hamizhong.iflowers.service.IAdminService;
import com.hamizhong.iflowers.utils.MyColumnIndicator;
import com.hamizhong.iflowers.utils.MyConstants;
import com.hamizhong.iflowers.web.base.MyBaseAction;
import com.hamizhong.iflowers.web.vo.AdminVO;

public class AdminManageAction extends MyBaseAction {

	private IAdminService iAdminService;
	
	public IAdminService getiAdminService() {
		return iAdminService;
	}
	public void setiAdminService(IAdminService iAdminService) {
		this.iAdminService = iAdminService;
	}

	@Override
	protected String doRequest() {
		logger.info("-------------------AdminManageAction-------------------");
		AdminVO adminVO = (AdminVO) getSSN().getAttribute(MyConstants.IFLOWERS_LOGIN_ADMIN_VO);
		if(adminVO == null) {
			return "LoginADM";
		}
		if(adminVO.getAdminType() == MyColumnIndicator.ADMIN_TYPE_SUPER) {
			adminVO.setAdminTypeStr(MyColumnIndicator.ADMIN_TYPE_SUPER_STR);
		}else if(adminVO.getAdminType() == MyColumnIndicator.ADMIN_TYPE_COMMON) {
			adminVO.setAdminTypeStr(MyColumnIndicator.ADMIN_TYPE_COMMON_STR);
		}
		getRQ().setAttribute("adminVO", adminVO);
		return SUCCESS;
	}

}
